@extends('oms-backend::layouts.default')

@section('breadcrumbs')
    <h2>FTP设置</h2>
    <ol class="breadcrumb">
        <li><a href="{!!route('admin.store.index')!!}"><i class="fa fa-dashboard"></i>首页</a></li>
        <li class="active">FTP设置</li>
    </ol>
@endsection


@section('content')
    <div class="ibox float-e-margins">
        <div class="ibox-content" style="display: block;">
            <form method="post" action="{{route('admin.oms.saveSettings')}}" class="form-horizontal"
                  id="setting_site_form">
                {{csrf_field()}}

                <div class="form-group">
                    <label class="col-sm-2 control-label">host：</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control"
                               value="{{settings('oms_ftp_host')}}"
                               name="oms_ftp_host" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">port：</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control"
                               value="{{settings('oms_ftp_port')}}"
                               name="oms_ftp_port" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">username：</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control"
                               value="{{settings('oms_ftp_username')}}"
                               name="oms_ftp_username" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">password：</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control"
                               value="{{settings('oms_ftp_password')}}"
                               name="oms_ftp_password" placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">passive：</label>

                    <div class="col-sm-10">
                        <select name="oms_ftp_passive" class="form-control">
                            <option value="1" {{settings('oms_ftp_passive')?'selected':''}}>true</option>
                            <option value="0" {{settings('oms_ftp_passive')?'':'selected'}}>false</option>
                        </select>
                    </div>
                </div>
                <div class="form-group"><label class="col-sm-2 control-label">ftp开启:</label>
                    <div class="col-sm-10">
                        <select name="ftp_enable" class="form-control">
                            <option value="1" {{settings('ftp_enable')?'selected':''}}>true</option>
                            <option value="0" {{settings('ftp_enable')?'':'selected'}}>false</option>
                        </select>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button class="btn btn-primary" type="submit">保存设置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>



@endsection

@section('after-scripts-end')

    {!! Html::script(env("APP_URL").'/assets/backend/libs/jquery.form.min.js') !!}

    <script>
        $(function () {
            $('#setting_site_form').ajaxForm({
                success: function (result) {
                    swal({
                        title: "保存成功！",
                        text: "",
                        type: "success"
                    }, function () {
                        location.reload();
                    });

                }
            });
        });


    </script>
@stop